package io

type (

	// Closed 是否已关闭
	Closed interface{ Closed() bool }

	// Debugger 是否调试
	Debugger interface{ Debug(b ...bool) }
)

/*
	multiCloser
	合并多个Closer , 变成1个Closer
*/
type multiCloser struct {
	closer []Closer
}

func (this *multiCloser) Close() error {
	var err error
	for _, v := range this.closer {
		if er := v.Close(); er != nil {
			err = er
		}
	}
	return err
}

// MultiCloser 多个关闭合并
func MultiCloser(closer ...Closer) Closer {
	return &multiCloser{closer: closer}
}
